#pragma once

/*
    1.定义出枚举类,枚举日志等级
    2.提供转换接口,将等级转换为对应字符串
*/

namespace jiuqilog
{
    class LogLevel
    {
    public:
        enum class value
        {
            UNKNOW = 0,  //未知
            DEBUG,       //调试
            INFO,        //提示
            WARN,        //警告
            ERROR,       //错误
            FATAL,       //致命错误
            OFF          //关闭
        };
        static const char *toString(LogLevel::value value)
        {
            switch (value)
            {
            case LogLevel::value::DEBUG: return "DEBUG"; 
            case LogLevel::value::INFO: return "INFO"; 
            case LogLevel::value::WARN: return "WARN"; 
            case LogLevel::value::ERROR: return "ERROR"; 
            case LogLevel::value::FATAL: return "FATAL"; 
            case LogLevel::value::OFF: return "OFF"; 
            }
            return "UNKNOW";
        }
    };
}